package com.controller;

import com.mapper.AddressMapper;
import com.pojo.Address;
import com.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class AddressController {
    @Autowired
    private AddressService addressService;
    @RequestMapping("/selectAddressByuserId")
    public Object selectByuserId(long id){
        return addressService.selectByuserId(id);
    }
    @RequestMapping("/addAddress")
    public Object addAddress(Address address){
        return addressService.insert(address);
    }
    @RequestMapping("/selectAddressById")
    public Object selectAddressById(long id){
        return addressService.selectAddressById(id);
    }
}
